package com.wondertek.web.controller.business;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.wondertek.common.base.Result;
import com.wondertek.common.util.base.StringUtil;
import com.wondertek.service.sdk.iotdh.dto.req.*;
import com.wondertek.service.sdk.iotdh.dto.req.arcConfig.AddArcConfigReq;
import com.wondertek.service.sdk.iotdh.dto.req.installer.AddCameraReq;
import com.wondertek.service.sdk.iotdh.dto.req.installer.GetSearchIpcResultReq;
import com.wondertek.service.sdk.iotdh.dto.req.installer.SearchIpcStartingReq;
import com.wondertek.service.sdk.iotdh.dto.req.installer.StopSearchIpcReq;
import com.wondertek.service.sdk.iotdh.dto.req.network.SetMobileNetworkReq;
import com.wondertek.service.sdk.iotdh.dto.req.scene.AddAccessorySceneModeReq;
import com.wondertek.service.sdk.iotdh.dto.req.scene.GetAccessorySceneModesReq;
import com.wondertek.service.sdk.iotdh.dto.req.utc.SetDeviceUTCTimezoneReq;
import com.wondertek.service.sdk.iotdh.dto.res.*;
import com.wondertek.service.sdk.iotdh.dto.res.arcConfig.GetArcConfigRes;
import com.wondertek.service.sdk.iotdh.dto.res.deviceDetail.ListDeviceDetailsByIdsRes;
import com.wondertek.service.sdk.iotdh.dto.res.installer.ComIdRes;
import com.wondertek.service.sdk.iotdh.dto.res.network.GetAroundWirelessNetworkInfosRes;
import com.wondertek.service.sdk.iotdh.dto.res.network.GetCurrentWirelessNetworkRes;
import com.wondertek.service.sdk.iotdh.dto.res.network.GetMobileNetworkInfoRes;
import com.wondertek.service.sdk.iotdh.dto.res.network.GetNetworkInfoRes;
import com.wondertek.service.sdk.iotdh.dto.res.pir.SetPIRAccessoryInfoReq;
import com.wondertek.service.sdk.iotdh.dto.res.alarmBell.SetODAlarmBellAccessoryInfoReq;
import com.wondertek.service.sdk.iotdh.dto.res.doorDetector.SetDoorDetectorAccessoryInfoReq;
import com.wondertek.service.sdk.iotdh.dto.res.doorDetectorPlus.SetDoorDetectorPlusAccessoryInfoReq;
import com.wondertek.service.sdk.iotdh.dto.res.keyboard.SetKeyboardAccessoryInfoReq;
import com.wondertek.service.sdk.iotdh.dto.res.scene.GetAccessorySceneModesRes;
import com.wondertek.service.sdk.iotdh.dto.res.test.SensitivityTestReq;
import com.wondertek.service.sdk.iotdh.dto.res.test.SignalStrengthTestReq;
import com.wondertek.service.sdk.iotdh.dto.res.utc.GetDevUTCTimezoneRes;
import com.wondertek.service.sdk.iotdh.service.DhDeviceService;
import com.wondertek.service.sdk.iotdh.service.DhSdkService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/dh/business/test")
@RequiredArgsConstructor
@CrossOrigin
@Tag(name = "sdk接口测试")
public class DhTestController {

    private final String strKey = "shafsdhfjashfkjahskdjfasjdfga";

    @Resource
    private final DhSdkService dhSdkService;

    @Resource
    private DhDeviceService dhDeviceService;

    @GetMapping("/token")
    @Operation(summary = "测试获取token")
    @ApiOperationSupport(order = 1)
    public String token() {
        return dhSdkService.getToken();
    }

    @PostMapping("/addDept")
    @Operation(summary = "新增部门")
    @ApiOperationSupport(order = 1)
    public String addDept(@RequestBody DeptAddDhReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhSdkService.addDept(req);
    }
    @PostMapping("/deleteDept")
    @Operation(summary = "删除部门")
    @ApiOperationSupport(order = 1)
    public String deleteDept(@RequestBody DeptDeleteReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhSdkService.deleteDept(req);
    }

    @PostMapping("/listDept")
    @Operation(summary = "查询部门")
    @ApiOperationSupport(order = 1)
    public String listDept(@RequestBody DeptListReq req) {
        return dhSdkService.listDept(req);
    }


    @PostMapping("/addDevice")
    @Operation(summary = "新增设备")
    @ApiOperationSupport(order = 2)
    public Result<DeviceAddDhRes> addDevice(@RequestBody @Validated DeviceDhAddReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.addDevice(req);
    }


    @PostMapping("/deleteDevice")
    @Operation(summary = "删除设备")
    @ApiOperationSupport(order = 3)
    public Result<?> deleteDevice(@RequestBody @Validated DeviceDhDeleteReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.deleteDevice(req);
    }

    @PostMapping("/pageDevice")
    @Operation(summary = "查询设备")
    @ApiOperationSupport(order = 4)
    public Result<DevicePageRes> pageDevice(@RequestBody @Validated DeviceListReq req) {
        return dhDeviceService.pageDevice(req);
    }


    @PostMapping("/operate")
    @Operation(summary = "设备操作 包括 抓图 重启 移动")
    @ApiOperationSupport(order = 5)
    public Result<?> operate(@RequestBody OperateDhReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.operate(req);
    }

    @PostMapping("/setTimingArmInfos")
    @Operation(summary = "设置定时部防撤防信息：对⽹关整体部防撤防进⾏设置")
    @ApiOperationSupport(order = 6)
    public Result<?> setTimingArmInfos(@RequestBody SetTimingArmInfosReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setTimingArmInfos(req);
    }

    @PostMapping("/getTimingArmInfos")
    @Operation(summary = "查询报警⽹关定时布撤防信息")
    @ApiOperationSupport(order = 7)
    public Result<GetTimingArmInfosRes> getTimingArmInfos(@RequestBody @Validated ComId req) {
        return dhDeviceService.getTimingArmInfos(req);
    }


    @PostMapping("/getAreaInfos")
    @Operation(summary = "查询分区信息：查看每个分区的启动状态及配件信息")
    @ApiOperationSupport(order = 8)
    public Result<GetAreaInfosRes> getAreaInfos(@RequestBody @Validated GetAreaInfosReq req) {
        return dhDeviceService.getAreaInfos(req);
    }


    @PostMapping("/setAreaInfo")
    @Operation(summary = "设置分区信息")
    @ApiOperationSupport(order = 9)
    public Result<?> setAreaInfo(@RequestBody @Validated AetAreaInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setAreaInfo(req);
    }




    @PostMapping("/getAreaArmMode")
    @Operation(summary = "查询该网关设备下的分区布防模式")
    @ApiOperationSupport(order = 10)
    public Result<GetAreaArmModeRes> getAreaArmMode(@RequestBody @Validated GetAreaInfosReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.getAreaArmMode(req);
    }


    @PostMapping("/setAreaArmMode")
    @Operation(summary = "设置分区布防模式")
    @ApiOperationSupport(order = 11)
    public Result<SetAreaArmModeRes> setAreaArmMode(@RequestBody @Validated SetAreaArmModeReq req) {
        return dhDeviceService.setAreaArmMode(req);
    }



    @PostMapping("/setAccessoryPair")
    @Operation(summary = "设置⽹关与配件配对：将设备挂载到⽹关下")
    @ApiOperationSupport(order = 12)
    public Result<?> getAreaArmMode(@RequestBody @Validated SetAccessoryPairReq req) {
        return dhDeviceService.setAccessoryPair(req);
    }



    @PostMapping("/getAccessoryInfo")
    @Operation(summary = "查询配件状态：查询⽹关设备下的所有配件信息")
    @ApiOperationSupport(order = 13)
    public Result<List<GetAccessoryInfoRes>> getAreaArmMode(@RequestBody @Validated GetAccessoryInfoReq req) {
        return dhDeviceService.getAccessoryInfo(req);
    }

    @PostMapping("/deleteAccessory")
    @Operation(summary = "删除网关设备下的配件")
    @ApiOperationSupport(order = 14)
    public Result<?> deleteAccessory(@RequestBody @Validated DeleteAccessoryReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.deleteAccessory(req);
    }

    @PostMapping("/setAccessoryArea")
    @Operation(summary = "设置配件分区：更改配件的分区")
    @ApiOperationSupport(order = 15)
    public Result<?> getAreaArmMode(@RequestBody @Validated SetAccessoryAreaReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setAccessoryArea(req);
    }



    @PostMapping("/subscribeDatas")
    @Operation(summary = "数据订阅接⼝")
    @ApiOperationSupport(order = 16)
    public Result<?> subscribeDatas(@RequestBody @Validated SubscribeDatasDhReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return Result.success(dhDeviceService.subscribeDatas(req));
    }

    @PostMapping("/subscribeCancel")
    @Operation(summary = "取消订阅接⼝")
    @ApiOperationSupport(order = 17)
    public Result<?> subscribeCancel(@RequestBody @Validated SubscribeCancelDhReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.subscribeCancel(req);
    }


    @PostMapping("/pageAlarm")
    @Operation(summary = "告警列表查询")
    @ApiOperationSupport(order = 18)
    public Result<PageAlarmRes> pageAlarm(@RequestBody @Validated AlarmListDhReq req) {
        return dhDeviceService.pageAlarm(req);
    }

    @PostMapping("/addStreamUrl")
    @Operation(summary = "视频推拉流创建")
    @ApiOperationSupport(order = 19)
    public Result<String> addStreamUrl(@RequestBody @Validated StreamUrlAddDhReq req) {
        return dhDeviceService.addStreamUrl(req);
    }


    @PostMapping("/getStatus")
    @Operation(summary = "查询⽹关设备状态")
    @ApiOperationSupport(order = 20)
    public Result<GetStatusRes> getStatus(@RequestBody @Validated GetStatusReq req) {
        return dhDeviceService.getStatus(req);
    }


    @PostMapping("/getEnable")
    @Operation(summary = "查询⽹查询报警⽹关使能")
    @ApiOperationSupport(order = 21)
    public Result<?> getEnable(@RequestBody @Validated GetEnableReq req) {
        return dhDeviceService.getEnable(req);
    }

    @PostMapping("/setEnable")
    @Operation(summary = "配置报警⽹关使能")
    @ApiOperationSupport(order = 22)
    public Result<?> setEnable(@RequestBody @Validated SetEnableReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setEnable(req);
    }


    @PostMapping("/setSmokeAccessoryInfo")
    @Operation(summary = "设置烟感信息")
    @ApiOperationSupport(order = 23)
    public Result<?> setSmokeAccessoryInfo(@RequestBody @Validated SetSmokeAccessoryInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setSmokeAccessoryInfo(req);
    }

    @PostMapping("/setNetworkInfo")
    @Operation(summary = "配置有线⽹络")
    @ApiOperationSupport(order = 24)
    public Result<?> setNetworkInfo(@RequestBody @Validated SetNetworkInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setNetworkInfo(req);
    }

    @PostMapping("/modifyWirelessNetwork")
    @Operation(summary = "配置⽆线⽹络")
    @ApiOperationSupport(order = 25)
    public Result<?> modifyWirelessNetwork(@RequestBody @Validated ModifyWirelessNetwork req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.modifyWirelessNetwork(req);
    }

    @PostMapping("/setKeyboardAccessoryInfo")
    @Operation(summary = "设置⽆线键盘信息")
    @ApiOperationSupport(order = 26)
    public Result<?> setKeyboardAccessoryInfo(@RequestBody @Validated SetKeyboardAccessoryInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setKeyboardAccessoryInfo(req);
    }

    @PostMapping("/setODAlarmBellAccessoryInfo")
    @Operation(summary = "设置室外警号")
    @ApiOperationSupport(order = 27)
    public Result<?> setODAlarmBellAccessoryInfo(@RequestBody @Validated SetODAlarmBellAccessoryInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setODAlarmBellAccessoryInfo(req);
    }


    @PostMapping("/setDoorDetectorAccessoryInfo")
    @Operation(summary = "设置⻔磁信息")
    @ApiOperationSupport(order = 28)
    public Result<?> setDoorDetectorAccessoryInfo(@RequestBody @Validated SetDoorDetectorAccessoryInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setDoorDetectorAccessoryInfo(req);
    }

    @PostMapping("/setDoorDetectorPlusAccessoryInfo")
    @Operation(summary = "设置升级⻔磁信息")
    @ApiOperationSupport(order = 29)
    public Result<?> setDoorDetectorPlusAccessoryInfo(@RequestBody @Validated SetDoorDetectorPlusAccessoryInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setDoorDetectorPlusAccessoryInfo(req);
    }

    @PostMapping("/setPIRAccessoryInfo")
    @Operation(summary = "设置PIR相机信息")
    @ApiOperationSupport(order = 30)
    public Result<?> setPIRAccessoryInfo(@RequestBody @Validated SetPIRAccessoryInfoReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setPIRAccessoryInfo(req);
    }
    @PostMapping("/sensitivityTest")
    @Operation(summary = "配件灵敏度测试")
    @ApiOperationSupport(order = 31)
    public Result<?> sensitivityTest(@RequestBody @Validated SensitivityTestReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.sensitivityTest(req);
    }

    @PostMapping("/signalStrengthTest")
    @Operation(summary = "信号强度测试")
    @ApiOperationSupport(order = 32)
    public Result<?> signalStrengthTest(@RequestBody @Validated SignalStrengthTestReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.signalStrengthTest(req);
    }


    @PostMapping("/LocalRecords")
    @Operation(summary = "获取回放列表")
    @ApiOperationSupport(order = 33)
    public Result<?> LocalRecords(@RequestBody @Validated LocalRecordsReq req) {
        return dhDeviceService.LocalRecords(req);
    }

    @PostMapping("/checkDeviceBindInfo")
    @Operation(summary = "设备-dolynck平台绑定状态查询")
    @ApiOperationSupport(order = 34)
    public Result<?> checkDeviceBindInfo(@RequestBody @Validated ComId req) {
        return dhDeviceService.checkDeviceBindInfo(req);
    }

    @PostMapping("/getIpcInstance")
    @Operation(summary = "获取ipc搜索实例(返回的的id⽤于后续操作)")
    @ApiOperationSupport(order = 35)
    public Result<ComIdRes> getIpcInstance(@RequestBody @Validated ComId req) {
        return dhDeviceService.getIpcInstance(req);
    }

    @PostMapping("/searchIpcStarting")
    @Operation(summary = "搜索附近IPC设备(该接⼝结合 获取搜索结果接⼝⼀起使⽤，⽤于添加IPC到⽹关)")
    @ApiOperationSupport(order = 36)
    public Result<?> searchIpcStarting(@RequestBody @Validated SearchIpcStartingReq req) {
        return dhDeviceService.searchIpcStarting(req);
    }

    @PostMapping("/getSearchIpcResult")
    @Operation(summary = "获取IPC设备搜索结果(在调⽤完搜索附近IPC设备后调⽤，能够获取上⼀个接⼝的搜索结果)")
    @ApiOperationSupport(order = 37)
    public Result<?> getSearchIpcResult(@RequestBody @Validated GetSearchIpcResultReq req) {
        return dhDeviceService.getSearchIpcResult(req);
    }

    @PostMapping("/stopSearchIpc")
    @Operation(summary = "停⽌搜索IPC设备")
    @ApiOperationSupport(order = 38)
    public Result<?> stopSearchIpc(@RequestBody @Validated StopSearchIpcReq req) {
        return dhDeviceService.stopSearchIpc(req);
    }

    @PostMapping("/addCamera")
    @Operation(summary = "将IPC设备添加到⽹关下")
    @ApiOperationSupport(order = 39)
    public Result<?> addCamera(@RequestBody @Validated AddCameraReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.addCamera(req);
    }


    @PostMapping("/setDeviceUTCTimezone")
    @Operation(summary = "配置设备的 UTC 时间 支持夏令时")
    @ApiOperationSupport(order = 40)
    public Result<?> setDeviceUTCTimezone(@RequestBody @Validated SetDeviceUTCTimezoneReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setDeviceUTCTimezone(req);
    }

    @PostMapping("/getDevUTCTimezone")
    @Operation(summary = "搜索设备时区和夏令时 （DST） 的配置")
    @ApiOperationSupport(order = 41)
    public Result<GetDevUTCTimezoneRes> getDevUTCTimezone(@RequestBody @Validated ComId req) {
        return dhDeviceService.getDevUTCTimezone(req);
    }

    @PostMapping("/setHeartbeat")
    @Operation(summary = "设置设备或配件心跳时间")
    @ApiOperationSupport(order = 42)
    public Result<?> setHeartbeat(@RequestBody @Validated SetHeartbeatReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setHeartbeat(req);
    }


    @PostMapping("/getAccessorySceneModes")
    @Operation(summary = "查询配件情景模式列表")
    @ApiOperationSupport(order = 43)
    public Result<GetAccessorySceneModesRes> getAccessorySceneModes(@RequestBody @Validated GetAccessorySceneModesReq req) {
        return dhDeviceService.getAccessorySceneModes(req);
    }

    @PostMapping("/addAccessorySceneMode")
    @Operation(summary = "新增配件情景模式")
    @ApiOperationSupport(order = 44)
    public Result<?> addAccessorySceneMode(@RequestBody @Validated AddAccessorySceneModeReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.addAccessorySceneMode(req);
    }

    @PostMapping("/addArcConfig")
    @Operation(summary = "添加报警接收中心配置")
    @ApiOperationSupport(order = 45)
    public Result<?> addArcConfig(@RequestBody @Validated AddArcConfigReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.addArcConfig(req);
    }

    @PostMapping("/getArcConfig")
    @Operation(summary = "搜索报警接收中心配置")
    @ApiOperationSupport(order = 46)
    public Result<GetArcConfigRes> getArcConfig(@RequestBody @Validated ComId req) {
        return dhDeviceService.getArcConfig(req);
    }

    @PostMapping("/deviceOnline")
    @Operation(summary = "查询设备在离线")
    @ApiOperationSupport(order = 47)
    public Result<?> deviceOnline(@RequestBody @Validated ComId req) {
        return dhDeviceService.deviceOnline(req);
    }

    @PostMapping("/subscribeList")
    @Operation(summary = "数据订阅记录列表")
    @ApiOperationSupport(order = 48)
    public Result<?> subscribeList() {
        return dhDeviceService.subscribeList();
    }

    @PostMapping("/modifyDevCode")
    @Operation(summary = "修改设备密码")
    @ApiOperationSupport(order = 49)
    public Result<?> modifyDevCode(@RequestBody @Validated ModifyDevCodeReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.modifyDevCode(req);
    }

    @PostMapping("/verifyDevCode")
    @Operation(summary = "确认设备密码")
    @ApiOperationSupport(order = 50)
    public Result<?> verifyDevCode(@RequestBody @Validated VerifyDevCodeReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.verifyDevCode(req);
    }

    @PostMapping("/upgradeDevice")
    @Operation(summary = "设备升级")
    @ApiOperationSupport(order = 51)
    public Result<?> upgradeDevice(@RequestBody @Validated VerifyDevCodeReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.upgradeDevice(req);
    }

    @PostMapping("/setAbilityStatus")
    @Operation(summary = "设备使能")
    @ApiOperationSupport(order = 52)
    public Result<?> setAbilityStatus(@RequestBody @Validated SetAbilityStatusReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setAbilityStatus(req);
    }

    @PostMapping("/setMobileNetwork")
    @Operation(summary = "设置移动网络")
    @ApiOperationSupport(order = 53)
    public Result<?> setMobileNetwork(@RequestBody @Validated SetMobileNetworkReq req,@RequestParam("strCode") String strCode) {
        if(StringUtil.isEmpty(strCode)||!strKey.equals(strCode)){
            return null;
        }
        return dhDeviceService.setMobileNetwork(req);
    }

    @PostMapping("/listDeviceDetailsByIds")
    @Operation(summary = "批量搜索设备详细信息")
    @ApiOperationSupport(order = 54)
    public Result<ListDeviceDetailsByIdsRes> listDeviceDetailsByIds(@RequestBody @Validated ListDeviceDetailsByIdsReq req) {
        return dhDeviceService.listDeviceDetailsByIds(req);
    }

    @PostMapping("/getNetworkInfo")
    @Operation(summary = "搜索有线网络信息")
    @ApiOperationSupport(order = 55)
    public Result<GetNetworkInfoRes> getNetworkInfo(@RequestBody @Validated ComId req) {
        return dhDeviceService.getNetworkInfo(req);
    }
    @PostMapping("/getCurrentWirelessNetwork")
    @Operation(summary = "搜索 Alarm Hub 正在使用的无线网络信息")
    @ApiOperationSupport(order = 56)
    public Result<GetCurrentWirelessNetworkRes> getCurrentWirelessNetwork(@RequestBody @Validated ComId req) {
        return dhDeviceService.getCurrentWirelessNetwork(req);
    }

    @PostMapping("/getMobileNetworkInfo")
    @Operation(summary = "搜索Alarm Hub的移动网络信息")
    @ApiOperationSupport(order = 57)
    public Result<List<GetMobileNetworkInfoRes>> getMobileNetworkInfo(@RequestBody @Validated ComId req) {
        return dhDeviceService.getMobileNetworkInfo(req);
    }

    @PostMapping("/getAroundWirelessNetworkInfos")
    @Operation(summary = "搜索 Alarm Hub 周围的无线网络信息")
    @ApiOperationSupport(order = 58)
    public Result<GetAroundWirelessNetworkInfosRes> getAroundWirelessNetworkInfos(@RequestBody @Validated ComId req) {
        return dhDeviceService.getAroundWirelessNetworkInfos(req);
    }

    @PostMapping("/getUpgradeVersionInfo")
    @Operation(summary = "搜索 Alarm Hub 的云更新版本")
    @ApiOperationSupport(order = 59)
    public Result<GetUpgradeVersionInfoRes> getUpgradeVersionInfo(@RequestBody @Validated ComId req) {
        return dhDeviceService.getUpgradeVersionInfo(req);
    }

    @PostMapping("/getUpgradeProgress")
    @Operation(summary = "搜索Alarm Hub的云更新进度")
    @ApiOperationSupport(order = 60)
    public Result<GetUpgradeProgressRes> getUpgradeProgress(@RequestBody @Validated ComId req) {
        return dhDeviceService.getUpgradeProgress(req);
    }

    @PostMapping("/getAccessoryStatus")
    @Operation(summary = "搜索连接到 Alarm Hub 的附件的状态")
    @ApiOperationSupport(order = 61)
    public Result<List<GetAccessoryStatusRes>> getAccessoryStatus(@RequestBody @Validated GetAccessoryInfoReq req) {
        return dhDeviceService.getAccessoryStatus(req);
    }

    @PostMapping("/deviceVersionList")
    @Operation(summary = "获取设备版本和可升级信息(NEW)")
    @ApiOperationSupport(order = 62)
    public Result<DeviceVersionListRes> deviceVersionList(@RequestBody @Validated DeviceVersionListReq req) {
        return dhDeviceService.deviceVersionList(req);
    }


}
